#!/bin/sh

echo "MinIO备份开始时间："
date "+%F %T"
echo

MINIO_BKPATH='/data/minio-backup'
MINIO_PATH='/data/minio'
DATE=$(date +%Y%m%d)
DATETIME=$(date +%Y%m%d%H%M)
MONTH_AGO=$(date -d "-2 month" +%Y%m)

cd ${MINIO_BKPATH}

echo "压缩: ${MINIO_PATH}"
tar -czvf ${DATETIME}.tar.gz ${MINIO_PATH}

/data/mysql_backup/mc cp ${DATETIME}.tar.gz minio3233/backup2022/${DATE}/${DATETIME}-minio-143-zc.tar.gz

rm -f ${DATETIME}.tar.gz

echo
echo "MinIO备份完成时间："
date "+%F %T"
echo
